home *** CD-ROM | disk | FTP | other *** search
- Path: news.cencom.net!ns!tanp
- From: tanp@ns (Bill Wendling)
- Newsgroups: comp.lang.c
- Subject: Re: How to give functions as parameters?
- Date: 1 Feb 1996 08:32:17 GMT
- Organization: Cen-Com Internet
- Message-ID: <4eptqh$jbs@news.cencom.net>
- References: <Pine.SUN.3.91N2x.960130222756.11581A-100000@yellow59.nada.kth.se>
- NNTP-Posting-Host: ns.cencom.net
- X-Newsreader: TIN [version 1.2 PL2]
-
- Per Steneskog inexplicably wrote:
-
- } I have a little problem, I dont know how to send a fuction,
- } as a parameter to another function..
-
-
-
- } #include <stdio.h>
-
- } void
- } do_it(void (*it)())
- } {
- } ((*(it))());
- } }
-
- }
- } void
- } do_me(
- } void)
- } {
- } printf("Testing!");
- } }
-
-
- } int
- } main(
- } void)
- } {
- } do_it(do_me()); /* ERROR-COMPILE LINE */
-
- Try this:
- do_it(do_me);
-
- } }
-
-
- Bill Wendling | "Pinky, are you thinking what I'm thinking?"
- tanp@ns.cencom.net | "I think so, Brain, but burlap chafes me so."
- "Boom Shanka" | Finger me for my Geek Code...NOW!
-